package org.example.skytool.date;

import org.springframework.stereotype.Component;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author 22449
 */
@Component
public class TimeZoneUtil {

    public static String getNowTime() {
        ZonedDateTime time = Instant.now().atZone(ZoneId.of("Asia/Shanghai"));
        LocalDateTime localDateTime = time.toLocalDateTime();
        return localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
    }

}
